DropDownListItem = {}

function DropDownListItem:ctor()
    
end

function DropDownListItem:setUIData(data)
    self.label.string = data.text
    self.ball.active = data.selected
end

function Node.DropDownListItem(v)
    local item = Node.Sprite():wh(120, 30)
    item.color = Color.lightBlue
    local ball = Node.Sprite("circle16"):addTo(item):wh(15, 15)
    ball:addComponent(Align):axy(0.5, 0.5)
    ball.alignPercentX = 0
    ball.alignOffsetX = 10
    ball.color = Color.black
    item.ball = ball
    local label = Node.Label(v.text):addTo(item)
    label:addComponent(Align):axy(0, 0.5)
    label.alignPercentX = 0
    label.alignOffsetX = 25
    item:addComponent(HoverArea)
    item.style = Styles.hover
    item.label = label
    return item
end

ObjectPool.dropDownListItem = ObjectPool.new(function(data)
    return Node.DropDownListItem()
end)